package com.hddz.comlib.packet;

import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.Date;
import java.util.List;

public abstract class Packet implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 原始报文内容
	 */
	public String sourceText;
	/**
	 * 报文显示内容
	 */
	public String viewText;
	
	private Date aliveDate;

	public Packet() {
		this.sourceText = this.viewText = "";
	}

	abstract public String createViewText();

	abstract public Boolean parse(List<Byte> data, int start, int len);

	abstract public Boolean parse(ByteBuffer data, int len);

	public String getSourceText() {
		return sourceText;
	}

	public void setSourceText(String sourceText) {
		this.sourceText = sourceText;
	}

	public String getViewText() {
		return viewText;
	}

	public void setViewText(String viewText) {
		this.viewText = viewText;
	}

	public Date getAliveDate() {
		return aliveDate;
	}

	public void setAliveDate(Date aliveDate) {
		this.aliveDate = aliveDate;
	}
}
